From 0b942e38944b2d43db4863fa3fb71e166b72b3e9 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 20 Jan 2003 20:11:53 +0000 Subject: [PATCH] We need a shorthandle for both read and write. --- gpsbabel/magproto.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index c2ca6377f..cf945397a 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -668,6 +668,9 @@ mag_rd_init(const char *portname, const char *args) } terminit(portname); + if (!mkshort_handle) { + mkshort_handle = mkshort_new_handle(); + } if (!noack) mag_handon(); @@ -715,8 +718,10 @@ mag_wr_init(const char *portname, const char *args) fstat(fileno(magfile_out), &sbuf); is_file = S_ISREG(sbuf.st_mode); #endif - mkshort_handle = mkshort_new_handle(); + if (!mkshort_handle) { + mkshort_handle = mkshort_new_handle(); + } if (is_file) { magfile_out = fopen(portname, "w+b"); if (magfile_out == NULL) { -- 2.30.2